import request from '@/request/request'

// 分页获取其他出库单
export function getOtherOutboundPage(pageParams) {
    return request({
        method: "get",
        url: '/warehouse/otherOutbound/page',
        params: pageParams
    })
}

// 创建其他出库单
export function createOtherOutbound(otherOutbound) {
    return request({
        method: "post",
        url: '/warehouse/otherOutbound',
        data: otherOutbound
    })
}

// 获取其他出库单详情（包含明细）
export function getOtherOutboundWithDetails(id) {
    return request({
        method: "get",
        url: `/warehouse/otherOutbound/withDetails/${id}`,
    })
}

// 更新其他出库单
export function updateOtherOutbound(otherOutbound) {
    return request({
        method: "put",
        url: '/warehouse/otherOutbound',
        data: otherOutbound
    })
}

// 删除其他出库单
export function deleteOtherOutbound(id) {
    return request({
        method: "delete",
        url: `/warehouse/otherOutbound/${id}`,
    })
}

// 获取可用的其他入库单列表（未出库的）
export function getAvailableOtherInboundList() {
    return request({
        method: "get",
        url: '/warehouse/otherInbound/available',
    })
}

// 根据其他入库单号获取仓库信息
export function getWarehouseByInboundNo(inboundNo) {
    return request({
        method: "get",
        url: `/warehouse/otherInbound/warehouse/${inboundNo}`,
    })
}
